#include <string>
#include <stdlib.h>
#include "paramHdl.h"
#include "message.h"
#include "opt.h"
#include "static.h"
using namespace Opt_NS;
using std::string;

//--------------------------------------------------------------------------
ParamHdl_C::ParamHdl_C(int p_nArgc,char* p_pArgv[])
{
    m_pOpt = new Opt_C;
    Static_C::setOpt(m_pOpt);
    m_pOpt->addOption("-fast", "fast mode", "", Opt::boolean);
    string default_path = getenv("ISPD_CONTEST_ROOT");
    m_pOpt->addOption("-path", "path(full)", default_path);
    m_pOpt->addOption("-benchmark", "benchmark", "simple");
    m_pOpt->addOption("-lib", "lib", "/lib/contest.lib");
    //m_pOpt->addOption("-ite", "LR Sizer MAX Iteration", "50");
    m_pOpt->setRequireOption("-path");
    m_pOpt->setRequireOption("-benchmark");
    m_pOpt->setRequireOption("-lib");
    
    m_pOpt->parseOption(p_nArgc, p_pArgv);
    
    if(! m_pOpt->checkValid() ) return;
    InfoMsg("Parameter parsed, showing in below..\n");
    
    InfoMsg("Begin Executing VDA Gate Sizer - Command Format Correct!\n");
    m_pOpt->printValue();
    return;
}
//--------------------------------------------------------------------------
ParamHdl_C::~ParamHdl_C()
{
    delete m_pOpt;
}
//--------------------------------------------------------------------------
